import 'dart:convert';

import 'package:flutter/services.dart';

class Channel {
  MethodChannel channel = const MethodChannel("learn_vpn");

  Future startService(
      {required String networkId, required bool useCellularData}) async {
    return await channel.invokeMethod('startService', {
      "data": jsonEncode({
        "networkId": networkId,
        "useCellularData": useCellularData,
      })
    });
  }

  Future stopService() async {
    return await channel.invokeMethod('stopService');
  }
}
